package seGobangResources;

import java.util.*;
import java.io.File;
import seGobangResources.Exceptions.*;

/**
 *
 * @author plus
 */
public class PathRes
{

    private static HashMap<String, String> PathTable = null;

    public PathRes()
    {
        init();
    }

    
    public static void init()
    {
        PathTable = new HashMap<String, String>();
        PathTable.put("Model/Room", new File("res/model/room.obj").getAbsolutePath());
        PathTable.put("Model/Chess", new File("res/model/chess.obj").getAbsolutePath());
        PathTable.put("Model/Indicator", new File("res/model/indicator.obj").getAbsolutePath());
        
        PathTable.put("Model/RobBase", new File("res/model/robBase.obj").getAbsolutePath());
        PathTable.put("Model/RobRot", new File("res/model/robRot.obj").getAbsolutePath());
        PathTable.put("Model/RobHand", new File("res/model/robHand.obj").getAbsolutePath());

        PathTable.put("Texture/Surface", new File("res/texture/surface.jpg").getAbsolutePath());
        PathTable.put("Texture/Wood", new File("res/texture/wood.jpg").getAbsolutePath());
        PathTable.put("Texture/MainMenu/Indict", new File("res/texture/MainMenu/blackChess.png").getAbsolutePath());
        for (int i = 1; i <= 5; i++)
        {
            PathTable.put("Texture/MainMenu/" + i + "A", new File("res/texture/MainMenu/" + i + "A.jpg").getAbsolutePath());
            PathTable.put("Texture/MainMenu/" + i + "B", new File("res/texture/MainMenu/" + i + "B.jpg").getAbsolutePath());
        }
        PathTable.put("Texture/MainMenu/back", new File("res/texture/MainMenu/back.jpg").getAbsolutePath());
        PathTable.put("Model/wf3", new File("res/model/wf3.jpg").getAbsolutePath());
        PathTable.put("Texture/black", new File("res/texture/black.jpg").getAbsolutePath());
        PathTable.put("Texture/white", new File("res/texture/white.jpg").getAbsolutePath());

        PathTable.put("Texture/Gaming/abandonA", new File("res/texture/gaming/buttAbandonGameA.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/abandonB", new File("res/texture/gaming/buttAbandonGameB.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/regretA", new File("res/texture/gaming/buttRegretA.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/regretB", new File("res/texture/gaming/buttRegretB.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/surrenderA", new File("res/texture/gaming/buttSurrenderA.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/surrenderB", new File("res/texture/gaming/buttSurrenderB.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/backblackA", new File("res/texture/gaming/infoBackBlackA.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/backblackB", new File("res/texture/gaming/infoBackBlackB.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/backwhiteA", new File("res/texture/gaming/infoWhiteBlackA.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/backwhiteB", new File("res/texture/gaming/infoWhiteBlackB.png").getAbsolutePath());

        PathTable.put("Texture/Gaming/backBlack3D", new File("res/texture/gaming/infoBoardBlackBack.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/backWhite3D", new File("res/texture/gaming/infoBoardWhiteBack.png").getAbsolutePath());

        PathTable.put("Texture/Gaming/AbandonA", new File("res/texture/gaming/buttAbandonGameA.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/AbandonB", new File("res/texture/gaming/buttAbandonGameB.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/RegretA", new File("res/texture/gaming/buttRegretA.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/RegretB", new File("res/texture/gaming/buttRegretB.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/SurrenderA", new File("res/texture/gaming/buttSurrenderA.png").getAbsolutePath());
        PathTable.put("Texture/Gaming/SurrenderB", new File("res/texture/gaming/buttSurrenderB.png").getAbsolutePath());

        PathTable.put("Texture/MessageBox/Mask", new File("res/texture/messageBox/mask.png").getAbsolutePath());
        PathTable.put("Texture/MessageBox/Box", new File("res/texture/messageBox/box.png").getAbsolutePath());
        PathTable.put("Texture/MessageBox/OkA", new File("res/texture/messageBox/okA.png").getAbsolutePath());
        PathTable.put("Texture/MessageBox/OkB", new File("res/texture/messageBox/okB.png").getAbsolutePath());
        PathTable.put("Texture/MessageBox/YesA", new File("res/texture/messageBox/yesA.png").getAbsolutePath());
        PathTable.put("Texture/MessageBox/YesB", new File("res/texture/messageBox/yesB.png").getAbsolutePath());
        PathTable.put("Texture/MessageBox/NoA", new File("res/texture/messageBox/noA.png").getAbsolutePath());
        PathTable.put("Texture/MessageBox/NoB", new File("res/texture/messageBox/noB.png").getAbsolutePath());

        PathTable.put("Texture/Entrance", new File("res/texture/Entrance.jpg").getAbsolutePath());
        PathTable.put("Texture/Config/Background", new File("res/texture/config/background.jpg").getAbsolutePath());
        PathTable.put("Texture/Config/Buttonback1", new File("res/texture/config/buttonback1.png").getAbsolutePath());
        PathTable.put("Texture/Config/Buttonback2", new File("res/texture/config/buttonback2.png").getAbsolutePath());
        
        PathTable.put("Texture/DeskBack", new File("res/texture/DeskBack.jpg").getAbsolutePath());
        PathTable.put("Texture/DeskNoRaise", new File("res/texture/DeskNoRaise.jpg").getAbsolutePath());
        PathTable.put("Texture/DeskRaise", new File("res/texture/DeskRaise.jpg").getAbsolutePath());
        PathTable.put("Texture/LoginBack", new File("res/texture/LoginBack.jpg").getAbsolutePath());
        PathTable.put("Texture/PlayerA", new File("res/texture/playerA.jpg").getAbsolutePath());
        PathTable.put("Texture/PlayerB", new File("res/texture/playerB.jpg").getAbsolutePath());
        PathTable.put("Texture/RoomBack", new File("res/texture/RoomBack.jpg").getAbsolutePath());
        PathTable.put("Texture/RoomListBack", new File("res/texture/RoomListBack.jpg").getAbsolutePath());
    }

    public static String getPath(String Key) throws Exception
    {
        if (PathTable == null)
        {
            init();
        }
        //
        String res = PathTable.get(Key);
        if (res == null)
        {
            System.err.println(Key);
            throw new StringNotExistException();
        }
        return res;
    }

    public static void main(String args[])
    {
        init();
        try
        {
            System.out.println(getPath("Model/Room"));
        } catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}
